<template>
	<view>
		<view class='order-submission'>
			<view class="allAddress">
				<view class='address acea-row row-between-wrapper'>
				<!-- <view class='address acea-row row-between-wrapper' @tap='cuIconTao'> -->
					<view class='addressCon' v-if="addressInfo.real_name" @tap='onAddress(addressInfo.real_name)'>
						<view class='name'>{{addressInfo.real_name}}
							<text class='phone'>{{addressInfo.phone}}</text>
						</view>
						<view class="line1">
							{{addressInfo.province}}{{addressInfo.city}}{{addressInfo.district}}{{addressInfo.street}}{{addressInfo.detail}}
						</view>
					</view>
					<view class='addressCon' v-else @tap="onAddress()">
						<view class='setaddress'>请选择收货地址</view>
					</view>
					<view class='iconfont icon-jiantou'></view>
				</view>
				<view class='line'>
					<image src='/static/images/address-line.png'></image>
				</view>
			</view>
			
			<view class="spu">
				<view class="sku-wrapper">
					<view class="image">
						<image :src="cartInfo[0].productInfo.image"></image>
					</view>
					<view class="content">
						<view class="title line2">{{cartInfo[0].productInfo.store_name}}</view>
						<view class="sku-info">{{cartInfo[0].bill.lease_way}}；{{cartInfo[0].productInfo.attrInfo.suk}}；1件</view>
					</view>
				</view>
				<view class="date-wrapper app-bac-tran">
					<view class="item">
						<view class="date-img">
							<image v-if="appType == 0"v-else src="../../../static/images/ic-star.png"></image>
							<image v-else-if="appType == 1" src="../../../static/images/ic-star1.png"></image>
							<image v-else-if="appType == 2" src="../../../static/images/ic-star2.png"></image>
						</view>
						<view class="content">
							<view class="title">预计起租日</view>
							<view class="date">{{start_date}}</view>
						</view>
					</view>
					<view class="item">
						<view class="date-img">
							<image v-if="appType == 0" src="../../../static/images/ic-end.png"></image>
							<image v-else-if="appType == 1" src="../../../static/images/ic-end1.png"></image>
							<image v-else-if="appType == 2" src="../../../static/images/ic-end2.png"></image>
						</view>
						<view class="content">
							<view class="title">预计截止日</view>
							<view class="date">{{end_time}}</view>
						</view>
					</view>
				</view>
				<view class="order-tip">
					提醒：快递运输期间不算租期，实际起租日为您签收快递的次日。
				</view>
			</view>
			
			<view class="suipingxian-wrapper">
				<image class="img" src="/static/images/suipingxian-bg.png"></image>
				<view class="content">
					<view class="left">
						<view class="title">意外险·租期内保障</view>
						<view class="desc">磕碰挤压意外碎屏免费换新</view>
					</view>
					<view class="right">
						<view>¥<text class="num">{{broker_screen_insurance}}</text></view>
					</view>
				</view>
			</view>
			
			<view class="rent-wrapper" @click="goRentList()">
				<view class="rent-title">
					租金明细
				</view>
				<view class="right">
					<view>立即查看</view>
					<view class='iconfont icon-jiantou'></view>
				</view>
			</view>
			
			<view class="first-rent">
				<view class="first-money">
					<view class="money-title">
						首期应付租金
					</view>
					<view class="money">
						¥<text class="num">{{first_stage_price}}</text>
					</view>
				</view>
				<view class="rent-item">
					<view class="item-left">尾期租金</view>
					<view class="item-right">¥{{last_stage_price }}</view>
				</view>
				<view class="rent-item">
					<view class="item-left">剩余租期</view>
					<view class="item-right">{{residue_stage}}期</view>
				</view>
				<view class="rent-item">
					<view class="item-left">总租金</view>
					<view class="item-right">¥{{rent_price}}</view>
				</view>
				<view class="rent-item">
					<view class="item-left">已优惠</view>
					<view class="item-right">暂无优惠</view>
				</view>
				<view class="rent-item">
					<view class="item-left">配送方式</view>
					<view class="item-right">寄出包邮·归还自付</view>
				</view>
				<view class="rent-item">
					<view class="item-left">租赁方式</view>
					<view class="item-right">{{lease_way}}</view>
				</view>
			</view>
			
			<view class="zm-credit">
				<view class="title">
					<view class="content">
						<image class="zm-img" src="../static/zm-icon.png"></image>
						<view class="txt">凭<text class="blue-txt">芝麻免押</text>最高可减免押金</view>
					</view>
					<view class="desc">
						点击“免押租”按钮，最高可全免
					</view>
				</view>
				<view class="money">
					<text class="unit">¥<text class="num">2000.00</text></text>
				</view>
			</view>
			
			<view class="accessory-wrapper" v-if="cartInfo[0].productInfo.accessory">
				<view class="title">
					<view>商品配件</view>
					<view class="sub-title">（套餐到期后需归还以下配件）</view>
				</view>
				
				<view class="accessory-item" v-for="(item, index) in cartInfo[0].productInfo.accessory">
					<view>{{item.gift_name}}*{{item.gift_num}}</view>
					<view>¥{{item.gift_price}}</view>
				</view>
			
			</view>
			
			<view style="height: 100rpx;"></view>
			
			<view class="height-add"></view>
			<view class='footer'>
				
				<view>
					<view class="footer-item">
						<view class="left" @click="selectFooter()">
							<image v-if="footerSelect && appType == 1" class="check-img" src="../../../static/images/ic-check1.png"></image>
							<image v-else-if="footerSelect && appType == 2" class="check-img" src="../../../static/images/ic-check2.png"></image>
							<image v-else-if="footerSelect " class="check-img" src="../../../static/images/ic-check.png"></image>
							<image v-else class="check-img" src="../../../static/images/ic-uncheck.png"></image>
						</view>

						<view class="footer-text">我已阅读<text class="agreement-color app-font-color" @click="privacy('privacy')">《用户协议》</text><text class="agreement-color app-font-color" @click="privacy('user')">《授权协议》</text><text class="agreement-color app-font-color" @click="toAgreement()">《租赁协议》</text></view>
					</view>
				</view>
				
				<view class="acea-row row-between-wrapper">
					<view>共1件，意外险应付<text class='money'>￥<text class="num">{{totalPrice || 0}}</text></text></view>
					
					<!-- <button
						open-type="getAuthorize"
						scope="phoneNumber"
						@getAuthorize="getAuthorize"
						@error="errorPhoneNumber"
						class='settlement app-btn-bg' 
						style='z-index:100'>免押租</button> -->
						
					<button
						@click="getAuthorize"
						class='settlement app-btn-bg' 
						style='z-index:100'>免押租</button>
				</view>
		
			</view>
		</view>
	</view>
</template>
<script>
	let app = getApp();

	import {
		orderConfirm,
		getCouponsOrderPrice,
		orderCreate,
		postOrderComputed,
		checkShipping
	} from '@/api/order.js';
	import {
		getAddressDefault,
		getAddressDetail,
		invoiceList,
		invoiceOrder,
		getUserTel,
		isAttestation,
		faceInitialize,
		isFaceVerify,
		faceVerify,
		faceQuery
	} from '@/api/user.js';
	import {
		openPaySubscribe
	} from '@/utils/SubscribeMessage.js';
	import {
		storeListApi
	} from '@/api/store.js';
	import {
		CACHE_LONGITUDE,
		CACHE_LATITUDE
	} from '@/config/cache.js';
	import couponListWindow from '@/components/couponListWindow';
	import addressWindow from '@/components/addressWindow';
	import orderGoods from '@/components/orderGoods';
	import home from '@/components/home';
	import invoicePicker from '../components/invoicePicker';
	import {
		toLogin
	} from '@/libs/login.js';
	import {
		mapGetters
	} from "vuex";
	import payment from '@/components/payment';
	import colors from "@/mixins/color";
	export default {
		components: {
			payment,
			invoicePicker,
			couponListWindow,
			addressWindow,
			orderGoods,
			home
		},
		mixins: [colors],
		data() {
			return {
				appType: app.globalData.appType,
				giveData:{
					give_integral:0,
					give_coupon:[]
				},
				giveCartInfo: [],
				confirm: [], //自定义留言
				id: 0,
				isaddress: false,
				textareaStatus: true,
				//支付方式
				cartArr: [
					{
						"name": "支付宝支付",
						"icon": "icon-zhifubao",
						value: 'alipay',
						title: '使用线上支付宝支付',
						payStatus: 1,
					},
					// {
					// 	"name": "余额支付",
					// 	"icon": "icon-yuezhifu",
					// 	value: 'yue',
					// 	title: '可用余额:',
					// 	payStatus: 1,
					// },
					{
						"name": "线下支付",
						"icon": "icon-yuezhifu1",
						value: 'offline',
						title: '选择线下付款方式',
						payStatus: 2,
					}
				],
				formContent: '',
				payType: 'alipay', //支付方式
				openType: 1, //优惠券打开方式 1=使用
				active: 0, //支付方式切换
				coupon: {
					coupon: false,
					list: [],
					statusTile: '立即使用'
				}, //优惠券组件
				address: {
					address: false
				}, //地址组件
				addressInfo: {}, //地址信息
				pinkId: 0, //拼团id
				addressId: 0, //地址id
				couponId: 0, //优惠券id
				cartId: '', //购物车id
				BargainId: 0,
				combinationId: 0,
				seckillId: 0,
				discountId: 0,
				userInfo: {}, //用户信息
				mark: '', //备注信息
				couponTitle: '请选择', //优惠券
				coupon_price: 0, //优惠券抵扣金额
				promotions_detail:[], //优惠活动金额明细
				useIntegral: false, //是否使用积分
				integral_price: 0, //积分抵扣金额
				integral: 0,
				ChangePrice: 0, //使用积分抵扣变动后的金额
				formIds: [], //收集formid
				status: 0,
				is_address: false,
				toPay: false, //修复进入支付时页面隐藏从新刷新页面
				shippingType: 0,
				system_store: {},
				storePostage: 0,
				contacts: '',
				contactsTel: '',
				mydata: {},
				storeList: [],
				store_self_mention: 0,
				cartInfo: [],
				priceGroup: {},
				animated: false,
				totalPrice: 0,
				integralRatio: "0",
				pagesUrl: "",
				orderKey: "",
				// usableCoupon: {},
				offlinePostage: "",
				isAuto: false, //没有授权的不会自动授权
				isShowAuth: false, //是否隐藏授权
				from: '',
				news: 1,
				invTitle: '不开发票',
				special_invoice: false,
				invoice_func: false,
				integral_ratio_status : 1,
				header_type: '',
				invShow: false,
				invList: [],
				invChecked: '',
				urlQuery: '',
				pay_close: false,
				noCoupon: 0,
				valid_count: 0,
				discount_id: 0,
				storeId: 0,
				product_type:1,
				newImg: [],
				isDisplay: 0,
				goodsType:0,
				latitude: '',
				longitude: '',
				first_stage_price: '',
				last_stage_price: '',
				residue_stage: '',
				lease_way: '',
				pay_price: '',
				rent_price: '',
				start_date: '',
				end_time: '',
				broker_screen_insurance: '',
				footerSelect: false,
			};
		},
		computed: mapGetters(['isLogin']),
		onLoad: function(options) {
			// #ifdef H5
			this.from = this.$wechat.isWeixin() ? 'weixin' : 'weixinh5'
			// #endif
			// #ifdef MP
			this.from = 'routine'
			// #endif
			if (!options.cartId) return this.$util.Tips({
				title: '请选择要购买的商品'
			}, {
				tab: 3,
				url: 1
			});
			this.couponId = options.couponId || 0;
			this.noCoupon = options.noCoupon || 0;
			this.pinkId = options.pinkId ? parseInt(options.pinkId) : 0;
			this.addressId = options.addressId || 0;
			this.cartId = options.cartId;
			this.is_address = options.is_address ? true : false;
			this.news = !options.new || options.new === '0' ? 0 : 1;
			this.invChecked = options.invoice_id || '';
			this.header_type = options.header_type || '1';
			this.couponTitle = options.couponTitle || '请选择'
			switch (options.invoice_type) {
				case '1':
					this.invTitle = '增值税电子普通发票';
					break;
				case '2':
					this.invTitle = '增值税电子专用发票';
					break;
			}
			if(options.invoice_name){
				this.invTitle = options.invoice_name;
			}
			// #ifndef APP-PLUS
			this.textareaStatus = true;
			// #endif
			if (this.isLogin && this.toPay == false) {
				// this.getCheckShipping();
				this.getaddressInfo();
				this.getConfirm();
			} else {
				//#ifndef MP
				toLogin();
				//#endif
				//#ifdef MP
				this.isShowAuth = true;
				//#endif
			}
			
			this.getLocation()
			
			
		},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			console.log('show')
			let _this = this
			uni.$on("handClick", res => {
				if (res) {
					_this.system_store = res.address
					_this.storeId = _this.system_store.id
					_this.cartId = res.cartId
					_this.news = res.new
					_this.pinkId = Number(res.pinkId)
					_this.couponId = res.couponId
					_this.getConfirm()
				}
				// 清除监听
				uni.$off('handClick');
			})
			
			// uni.$on("handPay", res => {
			// 	if (res) {
			// 		this.getAuthorize()
			// 	}
			// 	// 清除监听
			// 	uni.$off('handPay');
			// })
			
		},
		// beforeDestroy() {
		// 	// 移除事件监听，释放性能
		// 	console.log('beforeDestroyhandPay')
		// 	uni.$off('handPay')
		// },
		methods: {
			toAgreement() {
				console.log(this.cartInfo[0])
				uni.navigateTo({
					url: '/pages/lease/agreement?productId=' + this.cartInfo[0].product_id
					+ '&uniqueId=' + this.cartInfo[0].product_attr_unique
					+ '&stage_day=' + this.cartInfo[0].bill.stage_day
					+ '&total_day=' + this.cartInfo[0].bill.total_day
					+ '&lease_mode=' + this.cartInfo[0].bill.lease_mode
				})
			},
			privacy(type) {
				uni.navigateTo({
					url: "/pages/users/privacy/index?type=" + type
				})
			},
			selectFooter() {
				this.footerSelect = !this.footerSelect
			},
			goRentList() {
				const orderInfo = this.cartInfo[0]
				uni.setStorageSync('confirmOrder', orderInfo);
				uni.navigateTo({
					url: `/pages/lease/rent-list`
				})
			},
		
			cuIconTao() {
				my.getAddress({
					success: (res) => {
						console.log("getAddress", res)
						if (res.resultStatus == "9000") {
							const { fullname, mobilePhone, area, address, prov, city, street } = res.result
				
							this.addressInfo.real_name = fullname
							this.addressInfo.phone = mobilePhone
							this.addressInfo.province = prov
							this.addressInfo.city = city
							this.addressInfo.district = area
							this.addressInfo.street = street
							this.addressInfo.detail = address
							this.$set(this.addressInfo, 'addressInfo', false);
						}
					}
				})
			},
			getLocation() {
				let _this = this
				if (!app.globalData.location) {
					my.getLocation({
						type: 1,
						success(res) {
							_this.cityid = res.city
							console.log(res, "位置")
							_this.latitude = res.latitude
							_this.longitude = res.longitude
						},
						fail: (res) => {
						},
						complete: () => {
							app.globalData.location = true
						},
					})
				}
			
			},
			renlian() {
				
			},
			getAuthorize() {
				let _this = this;
				if (!_this.addressInfo.real_name) {
					_this.$util.Tips({
						title: '请选择收货地址'
					})
					return
				}
				
				if (!_this.footerSelect) {
					_this.$util.Tips({
						title: '请勾选并同意协议'
					})
					return
				}
				
				this.next()
				
				// my.getPhoneNumber({
				// 	 success: (res) => {
				// 		let asd = JSON.parse(res.response);
				// 		console.log(asd);
				// 		getUserTel(res.response).then((resd) => {
				// 		  if (resd.status == 200) {
				// 			this.next()
				// 		  }
				// 		})
				// 	 }
				// })
			},
			next() {
				let that = this;
				
				
				isFaceVerify().then(faceres => {
					if (!faceres.data.is_face_verify) {
						that.addressInfo.latitude = that.latitude
						that.addressInfo.longitude = that.longitude
						let data = {
							address_data: that.addressInfo,
							custom_form: that.confirm,
							real_name: that.contacts,
							phone: that.contactsTel,
							addressId: that.addressId,
							formId: '',
							couponId: that.priceGroup.couponPrice==0?0:that.couponId,
							payType: that.payType,
							useIntegral: that.useIntegral,
							bargainId: that.BargainId,
							combinationId: that.combinationId,
							discountId: that.discountId,
							pinkId: that.pinkId,
							seckill_id: that.seckillId,
							mark: that.mark,
							store_id: that.system_store ? that.system_store.id : 0,
							'from': that.from,
							shipping_type: that.$util.$h.Add(that.shippingType, 1),
							'new': that.news,
							'invoice_id': that.invChecked,
							quitUrl: 'pages/index/goodsDetails/goodsDetails?id=5'
						};
						uni.setStorageSync('payOrderKey', that.orderKey)
						uni.setStorageSync('payParams', data)
						uni.navigateTo({
							url: '/pages/lease/name-idcard'
						})
					} else {
						this.SubOrder()
					}
				})
		
			},
			// 授权关闭
			authColse: function(e) {
			  this.isShowAuth = e
			},
			// 是否显示快递配送
			getCheckShipping(){
				let data = {
					cartId: this.cartId,
					new: this.news
				}
				checkShipping(data).then(res=>{
					 this.isDisplay = res.data.type;
					 if(this.isDisplay == 2){
						 this.addressType(1)
					 }else{
						 this.getaddressInfo();
						 this.getConfirm();
						 this.$nextTick(function() {
							 this.$refs.addressWindow.getAddressList();
						 })
					 }
				}).catch(err=>{
					uni.showToast({
						title: err,
						icon: 'none'
					});
				})
			},
			/**
			 * 删除图片
			 * 
			 */
			DelPic: function(index, indexs) {
				let that = this,
					pic = this.confirm[index].value;
				that.confirm[index].value.splice(indexs, 1);
				that.$set(that.confirm[index], 'value', that.confirm[index].value);
			},
			
			/**
			 * 上传文件
			 * 
			 */
			uploadpic: function(index) {
				let that = this;
				this.$util.uploadImageOne('upload/image', function(res) {
					that.newImg.push(res.data.url);
					that.$set(that.confirm[index], 'value', that.newImg);
				});
			},
			// 不开发票
			invCancel() {
				this.invChecked = '';
				this.invTitle = '不开发票';
				this.invShow = false;
			},
			// 选择发票
			invChange(id) {
				this.invChecked = id;
				this.invShow = false;
				const result = this.invList.find(item => item.id === id);
				let name = '';
				name += result.header_type === 1 ? '个人' : '企业';
				name += result.type === 1 ? '普通' : '专用';
				name += '发票';
				this.invTitle = name;
			},
			// 关闭发票
			invClose() {
				this.invShow = false;
				this.getInvoiceList()
			},
			getInvoiceList() {
				uni.showLoading({
					title: '正在加载…'
				})
				invoiceList().then(res => {
					uni.hideLoading();
					this.invList = res.data.map(item => {
						item.id = item.id.toString();
						return item;
					});
					const result = this.invList.find(item => item.id == this.invChecked);
					if (result) {
						let name = '';
						name += result.header_type === 1 ? '个人' : '企业';
						name += result.type === 1 ? '普通' : '专用';
						name += '发票';
						this.invTitle = name;
					}
				}).catch(err => {
					uni.showToast({
						title: err,
						icon: 'none'
					});
				});
			},
			/**
			 * 开发票
			 */
			goInvoice: function() {
				this.getInvoiceList()
				this.invShow = true;
				this.urlQuery =
					`new=${this.news}&cartId=${this.cartId}&pinkId=${this.pinkId}&couponId=${this.couponId}&addressId=${this.addressId}&specialInvoice=${this.special_invoice}&couponTitle=${this.couponTitle}`;
			},
			/**
			 * 授权回调事件
			 * 
			 */
			onLoadFun: function() {
				this.getCheckShipping();
				this.isShowAuth = false;
				//调用子页面方法授权后执行获取地址列表
				// this.$scope.selectComponent('#address-window').getAddressList();
			},
			/**
			 * 事件回调
			 *
			 */
			onChangeFun: function(e) {
				let opt = e;
				let action = opt.action || null;
				let value = opt.value != undefined ? opt.value : null;
				action && this[action] && this[action](value);
			},
			payClose: function() {
				this.pay_close = false;
			},
			goPay() {
				console.log("goPay")
				// this.pay_close = true;
			},
			payCheck(type) {
				this.payType = type;
				this.SubOrder();
			},
			payAddress(){
					// console.log(this.id,this.news,this.cartId,this.pinkId,this.couponId)
				uni.navigateTo({
					// /pages/users/user_address/index?id=25&cartId=76179610656654229504&pinkId=0&couponId=0&new=1
					url: '/pages/users/user_address/index?id='+this.id +'&new=' + this.news + '&cartId=' + this.cartId +
					'&pinkId=' +
					this.pinkId +
					'&couponId=' +
					this.couponId
				})
			},
			/**
			 * 获取门店列表数据
			 */
			getList: function() {
				let data = {
					page: 1,
					limit: 10
				}
				storeListApi(data).then(res => {
					let list = res.data.list.list || [];
					this.$set(this, 'storeList', list);
					this.$set(this, 'system_store', list[0]);
					this.$set(this, 'storeId', list[0].id);
					this.getConfirm();
				}).catch(err => {})
			},
			// 关闭地址弹窗；
			changeClose: function() {
				this.$set(this.address, 'address', false);
			},
			changePayType(type) {
				this.payType = type
				this.computedPrice()
			},
			computedPrice: function() {
				let shippingType = this.shippingType;
				postOrderComputed(this.orderKey, {
					addressId: this.addressId,
					useIntegral: this.useIntegral ? 1 : 0,
					couponId: this.priceGroup.couponPrice==0?0:this.couponId,
					shipping_type: parseInt(shippingType) + 1,
					payType: this.payType
				}).then(res => {
					let result = res.data.result;
					if (result) {
						this.totalPrice = result.pay_price;
						this.integral_price = result.deduction_price;
						this.coupon_price = result.coupon_price;
						this.promotions_detail = result.promotions_detail;
						this.integral = this.useIntegral ? result.SurplusIntegral : this.userInfo.integral;
						this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.pay_postage);
						this.$set(this.priceGroup, 'storePostageDiscount', result.storePostageDiscount);
						
						this.$set(this, 'first_stage_price', result.bill.first_stage_price);
						this.$set(this, 'last_stage_price', result.bill.last_stage_price);
						this.$set(this, 'residue_stage', result.bill.residue_stage);
						this.$set(this, 'lease_way', result.bill.lease_way);
						
						this.$set(this, 'total_price', result.total_price);
						this.$set(this, 'rent_price', result.rent_price);
						this.$set(this, 'start_date', result.start_date);
						this.$set(this, 'end_time', result.end_time);
						
						this.$set(this, 'broker_screen_insurance', result.broker_screen_insurance)
						
					}
				}).catch(err=>{
					return that.$util.Tips({
						title: err
					});
				})
			},
			addressType: function(e) {
				let index = e;
				this.shippingType = parseInt(index);
				// this.computedPrice();
				if (index == 1){
					this.getList();
				} else{
					this.getConfirm();
				}
			},
			bindPickerChange: function(e) {
				let value = e.detail.value;
				this.shippingType = value;
				this.computedPrice();
			},
			ChangCouponsClone: function() {
				this.$set(this.coupon, 'coupon', false);
			},
			changeTextareaStatus: function() {
				for (let i = 0, len = this.coupon.list.length; i < len; i++) {
					this.coupon.list[i].use_title = '';
					this.coupon.list[i].is_use = 0;
				}
				this.textareaStatus = true;
				this.status = 0;
				this.$set(this.coupon, 'list', this.coupon.list);
			},
			/**
			 * 处理点击优惠券后的事件
			 * 
			 */
			ChangCoupons: function(e) {
				let index = e,
					list = this.coupon.list,
					couponTitle = '请选择',
					couponId = 0;
				for (let i = 0, len = list.length; i < len; i++) {
					if (i != index) {
						list[i].use_title = '';
						list[i].is_use = 0;
					}
				}
				if (list[index].is_use) {
					//不使用优惠券
					list[index].use_title = '';
					list[index].is_use = 0;
				} else {
					//使用优惠券
					list[index].use_title = '不使用';
					list[index].is_use = 1;
					couponTitle = list[index].coupon_title;
					couponId = list[index].id;
				}
				this.couponTitle = couponTitle;
				this.couponId = couponId;
				this.$set(this.coupon, 'coupon', false);
				this.$set(this.coupon, 'list', list);
				this.getConfirm(1);
			},
			/**
			 * 使用积分抵扣
			 */
			ChangeIntegral: function() {
				this.useIntegral = !this.useIntegral;
				this.computedPrice();
			},
			/**
			 * 选择地址后改变事件
			 * @param object e
			 */
			OnChangeAddress: function(e) {
				this.textareaStatus = true;
				this.addressId = e;
				this.address.address = false;
				this.getConfirm();
				this.getaddressInfo();
				this.computedPrice();
			},
			bindHideKeyboard: function(e) {
				this.mark = e.detail.value;
			},
			/**
			 * 获取当前订单详细信息
			 * 
			 */
			getConfirm: function(numType) {
			
				let that = this;
				// return;
				let shippingType = parseInt(this.shippingType) + 1;
				let addressId = 0,storeid;
				if(shippingType==1){
					 addressId = that.addressId
					 storeid = 0
				}else{
					 addressId = ''
					 storeid = that.storeId
				}
				uni.showLoading({
					title: '加载中...'
				})
				orderConfirm(that.cartId, that.news, addressId, shippingType,storeid,that.couponId).then(res => {
					if(res.data.upgrade_addr == 1){
						that.id = res.data.addressInfo.id
						this.isaddress = true
					}
					if(numType!=1){
						that.$set(that, 'confirm', res.data.custom_form);
					}
					that.$set(that, 'goodsType', res.data.type);
					that.$set(that, 'userInfo', res.data.userInfo);
					that.$set(that, 'integral', res.data.userInfo.integral);
					that.$set(that, 'contacts', res.data.userInfo.real_name);
					that.$set(that, 'contactsTel', res.data.userInfo.record_phone || '');
					that.$set(that, 'integralRatio', res.data.integralRatio);
					that.$set(that, 'offlinePostage', res.data.offlinePostage);
					that.$set(that, 'orderKey', res.data.orderKey);
					that.$set(that, 'valid_count', res.data.valid_count);
					that.$set(that, 'discount_id', res.data.discount_id)
					that.$set(that, 'priceGroup', res.data.priceGroup);
					that.$set(that, 'seckillId', parseInt(res.data.seckill_id));
					that.$set(that, 'BargainId', parseInt(res.data.bargain_id));
					that.$set(that, 'combinationId', parseInt(res.data.combination_id));
					that.$set(that, 'discountId', parseInt(res.data.discount_id));
					that.$set(that, 'invoice_func', res.data.invoice_func);
					that.$set(that, 'integral_ratio_status', res.data.integral_ratio_status);
					that.$set(that, 'special_invoice', res.data.special_invoice);
					that.$set(that, 'store_self_mention', res.data.store_self_mention);
					that.giveData.give_integral = res.data.give_integral;
					that.giveData.give_coupon = res.data.give_coupon;
					let cartInfo = res.data.cartInfo;
					let cartObj = [],giftObj = [];
					cartInfo.forEach(item=>{
						if(item.is_gift == 1){
							giftObj.push(item)
						}else{
							cartObj.push(item)
						}
					})
					that.$set(that, 'cartInfo', cartObj);
					console.log(that.cartInfo)
					that.$set(that, 'giveCartInfo', giftObj);
					
					
					that.computedPrice()
					
					/*
					
					let giveType = -1;
					giftObj.forEach(item=>{
						if(item.product_type==0){
							 return giveType = 0
						}
					})
					that.$set(that, 'product_type', (res.data.product_type==0 || giveType == 0)?0:1);
					//微信支付是否开启
					that.cartArr[0].payStatus = res.data.pay_weixin_open || 0
					//支付宝是否开启
					that.cartArr[1].payStatus = res.data.ali_pay_status || 0;
					//#ifdef MP
					that.cartArr[1].payStatus = 0;
					//#endif
					//余额支付是否开启
					// that.cartArr[2].title = '可用余额:' + res.data.userInfo.now_money;
					that.cartArr[2].number = res.data.userInfo.now_money;
					that.cartArr[2].payStatus = res.data.yue_pay_status == 1 ? res.data.yue_pay_status : 0
					if (res.data.offline_pay_status == 2) {
						that.cartArr[3].payStatus = 0
					} else {
						that.cartArr[3].payStatus = 1
					}
					
					*/

					// that.$set(that, 'cartArr', that.cartArr);
					
					// that.$set(that, 'ChangePrice', that.totalPrice);
					// that.getBargainId();
					// that.getCouponList();
					// that.computedPrice();
					// if (this.addressId || this.couponId) {
					// 	// this.computedPrice();
					// }else{
					// 	that.$set(that, 'totalPrice', that.$util.$h.Add(parseFloat(res.data.priceGroup.totalPrice),
					// 		parseFloat(res.data
					// 			.priceGroup.storePostage)));
					// }
					
					uni.hideLoading()
				}).catch(err => {
					uni.hideLoading()
					return this.$util.Tips({
						title: err
					});
				});
			},
			/*
			 * 提取砍价和拼团id
			 */
			getBargainId: function() {
				let that = this;
				// let cartINfo = that.cartInfo;
				// let BargainId = 0;
				// let combinationId = 0;
				// let discountId = 0;
				// cartINfo.forEach(function(value, index, cartINfo) {
				// 	BargainId = cartINfo[index].bargain_id,
				// 		combinationId = cartINfo[index].combination_id,
				// 		discountId = cartINfo[index].discount_id
				// })
				// that.$set(that, 'BargainId', parseInt(BargainId));
				// that.$set(that, 'combinationId', parseInt(combinationId));
				// that.$set(that, 'discountId', parseInt(discountId));
				if (that.cartArr.length == 3 && (that.BargainId || that.combinationId || that.seckillId || that.discountId)) {
					that.cartArr[2].payStatus = 0;
					that.$set(that, 'cartArr', that.cartArr);
				}
			},
			/**
			 * 获取当前金额可用优惠券
			 * 
			 */
			getCouponList: function() {
				let that = this;
				let data = {
					cartId: this.cartId,
					'new': this.news,
					shipping_type: that.$util.$h.Add(that.shippingType, 1),
					store_id: that.system_store ? that.system_store.id : 0
				}
				getCouponsOrderPrice(this.totalPrice, data).then(res => {
					that.$set(that.coupon, 'list', res.data);
					that.openType = 1;
				});
			},
			/*
			 * 获取默认收货地址或者获取某条地址信息
			 */
			getaddressInfo: function() {
				let that = this;
				if (that.addressId) {
					getAddressDetail(that.addressId).then(res => {
						res.data.is_default = parseInt(res.data.is_default);
						that.addressInfo = res.data || {};
						that.addressId = res.data.id || 0;
						that.address.addressId = res.data.id || 0;
					})
				} else {
					getAddressDefault().then(res => {
						res.data.is_default = parseInt(res.data.is_default);
						that.addressInfo = res.data || {};
						that.addressId = res.data.id || 0;
						that.address.addressId = res.data.id || 0;
					})
				}
			},
			payItem: function(e) {
				let that = this;
				let active = e;
				that.active = active;
				that.animated = true;
				that.payType = that.cartArr[active].value;
				that.computedPrice();
				setTimeout(function() {
					that.car();
				}, 500);
			},
			couponTap: function() {
				this.coupon.coupon = true;
				this.coupon.list.forEach((item, index) => {
					if (item.id == this.couponId) {
						item.is_use = 1
					} else {
						item.is_use = 0
					}
				})
				this.$set(this.coupon, 'list', this.coupon.list);
			},
			car: function() {
				let that = this;
				that.animated = false;
			},
			onAddress: function(name) {
				console.log(name)
				let that = this;
				if(name){
					that.textareaStatus = false;
					that.address.address = true;
					that.pagesUrl = '/pages/users/user_address_list/index?news=' + this.news + '&cartId=' + this.cartId +
						'&pinkId=' +
						this.pinkId +
						'&couponId=' +
						this.couponId;
					uni.navigateTo({
						url: that.pagesUrl
					})
				}else{
					uni.navigateTo({
						url:'/pages/users/user_address/index?new='+this.news + '&cartId=' + this.cartId + '&pinkId=' +
						this.pinkId + '&couponId=' + this.couponId
					})
				}
			},
			payment: function(data) {
				let that = this;
			
				orderCreate(that.orderKey, data).then(res => {
					if (res.status == 200) {
						uni.redirectTo({
							url: '/pages/module/order-success?order_id=' + res.data.result.orderId
						})
						
						// uni.redirectTo({
						// 	url: '/pages/goods/order_pay_status/index?order_id=' + res.data.result.orderId + '&msg=' + res.msg + '&type=3' + '&totalPrice=' + this.totalPrice
						// })
					}

				// 	let status = res.data.status,
				// 		orderId = res.data.result.orderId,
				// 		jsConfig = res.data.result.jsConfig,
				// 		goPages = '/pages/goods/order_pay_status/index?order_id=' + orderId + '&msg=' + res.msg +
				// 		'&type=3' + '&totalPrice=' + this.totalPrice
				// 	switch (status) {
				// 		case 'ORDER_EXIST':
				// 		case 'EXTEND_ORDER':
				// 		case 'PAY_ERROR':
				// 			uni.hideLoading();
				// 			return that.$util.Tips({
				// 				title: res.msg
				// 			}, {
				// 				tab: 5,
				// 				url: goPages
				// 			});
				// 			break;
				// 		case 'SUCCESS':
				// 			uni.hideLoading();
				// 			if (that.BargainId || that.combinationId || that.pinkId || that.seckillId || that
				// 				.discountId)
				// 				return that.$util.Tips({
				// 					title: res.msg,
				// 					icon: 'success'
				// 				}, {
				// 					tab: 4,
				// 					url: goPages
				// 				});
				// 			return that.$util.Tips({
				// 				title: res.msg,
				// 				icon: 'success'
				// 			}, {
				// 				tab: 5,
				// 				url: goPages
				// 			});
				// 			break;
				// 		case 'WECHAT_PAY':
				// 			that.toPay = true;
				// 			// #ifdef MP
				// 			/* that.toPay = true; */
				// 			uni.requestPayment({
				// 				timeStamp: jsConfig.timestamp,
				// 				nonceStr: jsConfig.nonceStr,
				// 				package: jsConfig.package,
				// 				signType: jsConfig.signType,
				// 				paySign: jsConfig.paySign,
				// 				success: function(res) {
				// 					uni.hideLoading();
				// 					if (that.BargainId || that.combinationId || that.pinkId || that
				// 						.seckillId || that.discountId)
				// 						return that.$util.Tips({
				// 							title: '支付成功',
				// 							icon: 'success'
				// 						}, {
				// 							tab: 4,
				// 							url: goPages
				// 						});
				// 					return that.$util.Tips({
				// 						title: '支付成功',
				// 						icon: 'success'
				// 					}, {
				// 						tab: 5,
				// 						url: goPages
				// 					});
				// 				},
				// 				fail: function(e) {
				// 					uni.hideLoading();
				// 					return that.$util.Tips({
				// 						title: '取消支付'
				// 					}, {
				// 						tab: 5,
				// 						url: goPages + '&status=2'
				// 					});
				// 				},
				// 				complete: function(e) {
				// 					uni.hideLoading();
				// 					//关闭当前页面跳转至订单状态
				// 					if (res.errMsg == 'requestPayment:cancel') return that.$util
				// 						.Tips({
				// 							title: '取消支付'
				// 						}, {
				// 							tab: 5,
				// 							url: goPages + '&status=2'
				// 						});
				// 				},
				// 			})
				// 			// #endif
				// 			// #ifdef H5
				// 			this.$wechat.pay(res.data.result.jsConfig).then(res => {
				// 				return that.$util.Tips({
				// 					title: '支付成功',
				// 					icon: 'success'
				// 				}, {
				// 					tab: 5,
				// 					url: goPages
				// 				});
				// 			}).catch(res => {
				// 				if (!this.$wechat.isWeixin()) {
				// 					uni.redirectTo({
				// 						url: goPages +
				// 							'&msg=支付失败&status=2'
				// 					})
				// 				}
				// 				if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
				// 					title: '取消支付'
				// 				}, {
				// 					tab: 5,
				// 					url: goPages + '&status=2'
				// 				});
				// 			})
				// 			// #endif
				// 			// #ifdef APP-PLUS
				// 			uni.requestPayment({
				// 				provider: 'wxpay',
				// 				orderInfo: jsConfig,
				// 				success: (e) => {
				// 					let url = goPages;
				// 					uni.showToast({
				// 						title: "支付成功"
				// 					})
				// 					setTimeout(res => {
				// 						uni.redirectTo({
				// 							url: url
				// 						})
				// 					}, 2000)
				// 				},
				// 				fail: (e) => {
				// 					let url = '/pages/goods/order_pay_status/index?order_id=' + orderId +
				// 						'&msg=支付失败';
				// 					uni.showModal({
				// 						content: "支付失败",
				// 						showCancel: false,
				// 						success: function(res) {
				// 							if (res.confirm) {
				// 								uni.redirectTo({
				// 									url: url
				// 								})
				// 							} else if (res.cancel) {
				// 								console.log('用户点击取消');
				// 							}
				// 						}
				// 					})
				// 				},
				// 				complete: () => {
				// 					uni.hideLoading();
				// 				},
				// 			});
				// 			// #endif
				// 			break;
				// 		case 'PAY_DEFICIENCY':
				// 			uni.hideLoading();
				// 			//余额不足
				// 			return that.$util.Tips({
				// 				title: res.msg
				// 			}, {
				// 				tab: 5,
				// 				url: goPages + '&status=1'
				// 			});
				// 			break;
				// 		case "WECHAT_H5_PAY": 
				// 			uni.hideLoading();
				// 			that.$util.Tips({
				// 				title: '订单创建成功!'
				// 			}, {
				// 				tab: 4,
				// 				url: goPages + '&status=0'
				// 			});
				// 			setTimeout(() => {
				// 				location.href = res.data.result.jsConfig.mweb_url;
				// 			}, 2000);
				// 			break;

				// 		case 'ALIPAY_PAY':
				// 			//#ifdef H5
				// 			if (this.from === 'weixin') {
				// 				uni.redirectTo({
				// 					url: `/pages/users/alipay_invoke/index?id=${orderId}&pay_key=${res.data.result.pay_key}`
				// 				});
				// 			} else {
				// 				uni.hideLoading();
				// 				that.formContent = res.data.result.jsConfig;
				// 				that.$nextTick(() => {
				// 					document.getElementById('alipaysubmit').submit();
				// 				})
				// 			}
				// 			//#endif
				// 			// #ifdef MP
				// 			uni.navigateTo({
				// 				url: `/pages/users/alipay_invoke/index?id=${orderId}&link=${jsConfig.qrCode}`
				// 			});
				// 			// #endif
				// 			// #ifdef APP-PLUS
				// 			uni.requestPayment({
				// 				provider: 'alipay',
				// 				orderInfo: jsConfig,
				// 				success: (e) => {
				// 					uni.showToast({
				// 						title: "支付成功"
				// 					})
				// 					let url = '/pages/goods/order_pay_status/index?order_id=' + orderId +
				// 						'&msg=支付成功';
				// 					setTimeout(res => {
				// 						uni.redirectTo({
				// 							url: url
				// 						})
				// 					}, 2000)

				// 				},
				// 				fail: (e) => {
				// 					let url = '/pages/goods/order_pay_status/index?order_id=' + orderId +
				// 						'&msg=支付失败';
				// 					uni.showModal({
				// 						content: "支付失败",
				// 						showCancel: false,
				// 						success: function(res) {
				// 							if (res.confirm) {
				// 								uni.redirectTo({
				// 									url: url
				// 								})
				// 							} else if (res.cancel) {
				// 								console.log('用户点击取消');
				// 							}
				// 						}
				// 					})
				// 				},
				// 				complete: () => {
				// 					uni.hideLoading();
				// 				},
				// 			});
				// 			// #endif
				// 			break;
				// 	}
				// }).catch(err => {
				// 	uni.hideLoading();
				// 	return that.$util.Tips({
				// 		title: err
				// 	});
				});
			},
			clickTextArea() {
				this.$refs.textarea.focus()
			},
			bindDateChange: function(e, index) {
				this.confirm[index].value = e.target.value
			},
			bindTimeChange: function(e, index) {
				this.confirm[index].value = e.target.value
			},
			SubOrder: function(e) {
				let that = this,
					data = {};

				// if (!that.payType) return that.$util.Tips({
				// 	title: '请选择支付方式'
				// });
				// if (!that.addressInfo.real_name)  {  return that.$util.Tips({
				// 	title: '请选择收货地址'
				// });
				// if (that.shippingType == 1) {
				// 	if (that.contacts == "" || that.contactsTel == "") {
				// 		return that.$util.Tips({
				// 			title: '请填写联系人或联系人电话'
				// 		});
				// 	}
				// 	if (!/^1(3|4|5|7|8|9|6)\d{9}$/.test(that.contactsTel)) {
				// 		return that.$util.Tips({
				// 			title: '请填写正确的手机号'
				// 		});
				// 	}
				// 	if (!/^[\u4e00-\u9fa5\w]{2,16}$/.test(that.contacts)) {
				// 		return that.$util.Tips({
				// 			title: '请填写您的真实姓名'
				// 		});
				// 	}
				// 	if (that.storeList.length == 0) return that.$util.Tips({
				// 		title: '暂无门店,请选择其他方式'
				// 	});
				// }
				// for (var i = 0; i < that.confirm.length; i++) {
				// 	let data = that.confirm[i]
				// 	if (data.status || (data.label !== 'img' && data.value && data.value.trim())) {
				// 		if (data.label === 'text' || data.label === 'data' || data.label === 'time') {
				// 			if (!data.value || (data.value && !data.value.trim())) {
				// 				return that.$util.Tips({
				// 					title: `请填写${data.title}`
				// 				});
				// 			}
				// 		}
				// 		if (data.label === 'number') {
				// 			if (data.value <= 0) {
				// 				return that.$util.Tips({
				// 					title: `请填写大于0的${data.title}`
				// 				});
				// 			}
				// 		}
				// 		if (data.label === 'email') {
				// 			if (!/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(data.value)) {
				// 				return that.$util.Tips({
				// 					title: `请填写正确的${data.title}`
				// 				});
				// 			}
				// 		}
				// 		if (data.label === 'phone') {
				// 			if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(data.value)) {
				// 				return that.$util.Tips({
				// 					title: `请填写正确的${data.title}`
				// 				});
				// 			}
				// 		}
						
				// 		if (data.label === 'id') {
				// 			if (!/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/i.test(data.value)) {
				// 				return that.$util.Tips({
				// 					title: `请填写正确的${data.title}`
				// 				});
				// 			}
				// 		}
						
				// 		if (data.label === 'img') {
				// 			if (!data.value.length) {
				// 				return that.$util.Tips({
				// 					title: `请上传${data.title}`
				// 				});
				// 			}
				// 		}
				// 	}
				// }
				that.addressInfo.latitude = that.latitude
				that.addressInfo.longitude = that.longitude
				data = {
					address_data: that.addressInfo,
					custom_form: that.confirm,
					real_name: that.contacts,
					phone: that.contactsTel,
					addressId: that.addressId,
					formId: '',
					couponId: that.priceGroup.couponPrice==0?0:that.couponId,
					payType: that.payType,
					useIntegral: that.useIntegral,
					bargainId: that.BargainId,
					combinationId: that.combinationId,
					discountId: that.discountId,
					pinkId: that.pinkId,
					seckill_id: that.seckillId,
					mark: that.mark,
					store_id: that.system_store ? that.system_store.id : 0,
					'from': that.from,
					shipping_type: that.$util.$h.Add(that.shippingType, 1),
					'new': that.news,
					'invoice_id': that.invChecked,
					quitUrl: 'pages/index/goodsDetails/goodsDetails?id=5'
					// #ifdef H5
					// quitUrl: location.protocol + '//' + location.hostname +
					// 	'/pages/goods/order_pay_status/index?' +
					// 	'&type=3' + '&totalPrice=' + this.totalPrice
					// #endif
					// #ifdef APP-PLUS
					// quitUrl: '/pages/goods/order_details/index'
					// #endif
				};
				// if (data.payType == 'yue' && parseFloat(that.userInfo.now_money) < parseFloat(that.totalPrice))
				// 	return that.$util.Tips({
				// 		title: '余额不足！'
				// 	});
				// uni.showLoading({
				// 	title: '订单支付中'
				// });
				
				
				that.payment(data);
				
				// // #ifdef MP
				// openPaySubscribe().then(() => {
				// 	that.payment(data);
				// });
				// // #endif
				// // #ifndef MP
				// that.payment(data);
				// // #endif
			}
		}
	}
</script>

<style lang="scss" scoped>
	.height-add {
		height: calc(120rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		height: calc(120rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
	}
	
	/deep/uni-checkbox[disabled] .uni-checkbox-input {
		background-color: #eee;
	}
	
	.confirmImg{
		width: 100%;
	}
	
	.confirmImg .upload {
		padding-bottom: 36rpx;
	}
	
	.confirmImg .upload .pictrue {
		margin: 22rpx 23rpx 0 0;
		width: 156rpx;
		height: 156rpx;
		position: relative;
		font-size: 24rpx;
		color: #bbb;
	}
	
	.confirmImg .upload .pictrue:nth-of-type(4n) {
		margin-right: 0;
	}
	
	.confirmImg .upload .pictrue image {
		width: 100%;
		height: 100%;
		border-radius: 3rpx;
	}
	
	.confirmImg .upload .pictrue .icon-guanbi1 {
		position: absolute;
		font-size: 45rpx;
		top: -10rpx;
		right: -10rpx;
	}
	
	.confirmImg .upload .pictrue .icon-icon25201 {
		color: #bfbfbf;
		font-size: 50rpx;
	}
	
	.confirmImg .upload .pictrue:nth-last-child(1) {
		border: 1rpx solid #ddd;
		box-sizing: border-box;
	}

	.alipaysubmit {
		display: none;
	}
	
	.order-submission .line {
		width: 100%;
		height: 3rpx;
	}

	.order-submission .line image {
		width: 100%;
		height: 100%;
		display: block;
	}

	.order-submission .address {
		padding: 28rpx 30rpx;
		background-color: #fff;
		box-sizing: border-box;
	}

	.order-submission .address .addressCon {
		width: 610rpx;
		font-size: 26rpx;
		color: #666;
	}

	.order-submission .address .addressCon .name {
		font-size: 30rpx;
		color: #282828;
		font-weight: bold;
		margin-bottom: 10rpx;
	}

	.order-submission .address .addressCon .name .phone {
		margin-left: 50rpx;
	}

	.order-submission .address .addressCon .default {
		margin-right: 12rpx;
	}

	.order-submission .address .addressCon .setaddress {
		color: #333;
		font-size: 28rpx;
		font-weight: bold;
	}

	.order-submission .address .iconfont {
		font-size: 35rpx;
		color: #707070;
	}

	.order-submission .allAddress {
		width: 100%;
		// background: linear-gradient(to bottom, var(--view-theme) 0%, #f5f5f5 100%);
		padding-top: 10rpx;
	}

	.order-submission .allAddress .nav {
		width: 710rpx;
		margin: 0 auto;
	}

	.order-submission .allAddress .nav .item {
		width: 355rpx;
	}

	.order-submission .allAddress .nav .item.on {
		position: relative;
		width: 250rpx;
	}

	.order-submission .allAddress .nav .item.on::before {
		position: absolute;
		bottom: 0;
		content: "快递配送";
		font-size: 28rpx;
		display: block;
		height: 0;
		width: 336rpx;
		border-width: 0 20rpx 80rpx 0;
		border-style: none solid solid;
		border-color: transparent transparent #fff;
		z-index: 2;
		border-radius: 7rpx 30rpx 0 0;
		text-align: center;
		line-height: 80rpx;
	}

	.order-submission .allAddress .nav .item:nth-of-type(2).on::before {
		content: "到店自提";
		border-width: 0 0 80rpx 20rpx;
		border-radius: 30rpx 7rpx 0 0;
	}

	.order-submission .allAddress .nav .item.on2 {
		position: relative;
	}

	.order-submission .allAddress .nav .item.on2::before {
		position: absolute;
		bottom: 0;
		content: "到店自提";
		font-size: 28rpx;
		display: block;
		height: 0;
		width: 400rpx;
		border-width: 0 0 60rpx 60rpx;
		border-style: none solid solid;
		border-color: transparent transparent rgba(255,255,255,0.6);
		border-radius: 40rpx 6rpx 0 0;
		text-align: center;
		line-height: 60rpx;
	}

	.order-submission .allAddress .nav .item:nth-of-type(1).on2::before {
		content: "快递配送";
		border-width: 0 60rpx 60rpx 0;
		border-radius: 6rpx 40rpx 0 0;
	}

	.order-submission .allAddress .address {
		width: 710rpx;
		height: 150rpx;
		margin: 0 auto;
		border-radius: 16rpx;
		overflow: hidden;
	}

	.order-submission .allAddress .line {
		width: 710rpx;
		margin: 0 auto;
	}

	.order-submission .wrapper .item .discount .placeholder {
		color: #ccc;
	}

	.placeholder-textarea {
		position: relative;

		.placeholder {
			position: absolute;
			color: #ccc;
			top: 26rpx;
			left: 30rpx;
		}
	}

	.order-submission .wrapper {
		// background-color: #fff;
		margin-top: 13rpx;
	}
	
	.order-submission .wrapper .item .name{
		position: relative;
		width: 190rpx;
		
	}
	
	.order-submission .wrapper .item .asterisk{
		position: absolute;
		color:red;
		left:-15rpx
	}

	.order-submission .wrapper .item {
		padding: 27rpx 30rpx;
		font-size: 30rpx;
		color: #282828;
		border-bottom: 1px solid #f0f0f0;
		margin-top: 20rpx;
		background-color: #fff;
		border-radius: 16rpx;
	}

	.order-submission .wrapper .item .discount {
		font-size: 30rpx;
		color: #999;
	}

	.order-submission .wrapper .item .discount input {
		text-align: right;
		width: 450rpx;
	}

	.order-submission .wrapper .item .discount .iconfont {
		color: #515151;
		font-size: 30rpx;
		margin-left: 15rpx;
	}

	.order-submission .wrapper .item .discount .num {
		font-size: 32rpx;
		margin-right: 20rpx;
	}

	.order-submission .wrapper .item .shipping {
		font-size: 30rpx;
		color: #999;
		position: relative;
		padding-right: 58rpx;
	}

	.order-submission .wrapper .item .shipping .iconfont {
		font-size: 35rpx;
		color: #707070;
		position: absolute;
		right: 0;
		top: 50%;
		transform: translateY(-50%);
		margin-left: 30rpx;
	}

	.order-submission .wrapper .item textarea {
		background-color: #f9f9f9;
		width: 690rpx;
		height: 140rpx;
		border-radius: 3rpx;
		margin-top: 30rpx;
		padding: 25rpx 28rpx;
		box-sizing: border-box;
	}

	.order-submission .wrapper .item .placeholder {
		color: #ccc;
	}

	.order-submission .wrapper .item .list {
		margin-top: 35rpx;
	}

	.order-submission .wrapper .item .list .payItem {
		border: 1px solid #eee;
		border-radius: 6rpx;
		height: 86rpx;
		width: 100%;
		box-sizing: border-box;
		margin-top: 20rpx;
		font-size: 28rpx;
		color: #282828;
	}

	.order-submission .wrapper .item .list .payItem.on {
		border-color: #fc5445;
		color: #e93323;
	}

	.order-submission .wrapper .item .list .payItem .name {
		width: 50%;
		text-align: center;
		border-right: 1px solid #eee;
		padding-left: 80rpx;
	}

	.order-submission .wrapper .item .list .payItem .name .iconfont {
		width: 44rpx;
		height: 44rpx;
		border-radius: 50%;
		text-align: center;
		line-height: 44rpx;
		background-color: #fe960f;
		color: #fff;
		font-size: 30rpx;
		margin-right: 15rpx;
	}

	.order-submission .wrapper .item .list .payItem .name .iconfont.icon-weixin2 {
		background-color: #41b035;
	}

	.order-submission .wrapper .item .list .payItem .name .iconfont.icon-zhifubao {
		background-color: #1677FF;
	}

	.order-submission .wrapper .item .list .payItem .tip {
		width: 49%;
		text-align: center;
		font-size: 26rpx;
		color: #aaa;
	}

	.order-submission .moneyList {
		margin-top: 12rpx;
		background-color: #fff;
		padding: 30rpx;
	}

	.order-submission .moneyList .item {
		font-size: 28rpx;
		color: #282828;
	}

	.order-submission .moneyList .item~.item {
		margin-top: 20rpx;
	}

	.order-submission .moneyList .item .money {
		color: #868686;
	}

	.order-submission .footer {
		width: 100%;
		height: 180rpx;
		background-color: #fff;
		padding: 0 30rpx;
		font-size: 28rpx;
		color: #333;
		box-sizing: border-box;
		position: fixed;
		bottom: 0;
		left: 0;
		z-index: 9;
		border-top: 1px solid #f0f0f0;
		height: calc(180rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		height: calc(180rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
		padding-bottom: calc(0rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
		padding-bottom: calc(0rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
		
		.money {
			color: #FF1F2E;
		}
		
		.num {
			font-size: 34rpx;
			font-weight: bold;
		}
	}

	.order-submission .footer .settlement {
		font-size: 30rpx;
		color: #fff;
		width: 240rpx;
		height: 80rpx;
		background: linear-gradient(90deg, #71EBDA 0%, #39CCC2 100%);
		border-radius: 50rpx;
		text-align: center;
		line-height: 80rpx;
		border: none !important;
	}

	.footer .transparent {
		opacity: 0
	}
	.tipaddress {
		position: fixed;
		left: 13%;
		top: 25%;
		// margin-left: -283rpx;
		width: 560rpx;
		height: 614rpx;
		background-color: #fff;
		border-radius: 10rpx;
		z-index: 100;
		text-align: center;
		
		.top{
			width: 560rpx;
			height: 270rpx;
			border-top-left-radius: 10rpx;
			border-top-right-radius: 10rpx;
			background-image: url(../../../static/images/address.png);
			background-repeat: round;
			background-color: var(--view-theme);
			.tipsphoto{
				display: inline-block;
				width: 200rpx;
				height: 200rpx;
				margin-top: 73rpx;
			}
		}
		
		.bottom{
			font-size: 32rpx;
			font-weight: 400;
			.font1{
				
				font-size: 36rpx;
				font-weight: 600;
				color: #333333;
				margin: 32rpx 0rpx 22rpx;
			}
			.font2{
				color: #666666;
				margin-bottom: 48rpx;
			}
			.btn{
				width: 360rpx;
				height: 82rpx;
				border-radius: 42rpx;
				background: linear-gradient(to left, var(--view-theme) 0%, #f5f5f5 100%);
				color: #FFFFFF;
				line-height: 82rpx;
				margin: 0 auto;
			}
		}
		
	}
	.mark {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		background: rgba(0, 0, 0, 0.5);
		z-index: 99;
	}
	
	.order-submission .wrapper {
		width: 710rpx !important;
		margin: 0 auto;
		margin-top: 20rpx;
	}
	
	.rent-wrapper {
		width: 710rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		background: linear-gradient(180deg, #F5FFFE 0%, #FFFFFF 100%);
		border-radius: 16rpx;
		padding: 32rpx 20rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		
		.rent-title {
			font-size: 32rpx;
			color: #1F1F1F;
			font-weight: bold;
		}
		
		.right {
			font-size: 24rpx;
			color: #999999;
			margin-right: 12rpx;
			display: flex;
			flex-direction: row;
			align-items: center;
			
			.icon-jiantou {
				font-size: 24rpx;
			}
		}
	}
	
	.first-rent {
		width: 710rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		background-color: #fff;
		padding: 14rpx 20rpx;
		border-radius: 16rpx;
	
		.first-money {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			height: 96rpx;
			border-bottom: 2rpx solid #f5f5f5;
			
			.money-title {
				font-size: 32rpx;
				font-weight: bold;
			}
			
			.money {
				font-size: 48rpx;
				font-weight: bold;
			}
		}
		
		.rent-item {
			height: 80rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 28rpx;

			.item-left {
				color: #666666;
			}
			
			.item-right {
				color: #1F1F1F;
			}
		}
	}
	
	.zm-credit {
		width: 710rpx;
		margin: 0 auto;
		background-color: #fff;
		border-radius: 16rpx;
		margin-top: 20rpx;
		padding: 20rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		
		.title {
			display: flex;
			flex-direction: column;
			
			.content {
				display: flex;
				align-items: center;
				
				.zm-img {
					width: 32rpx;
					height: 32rpx;
				}
				
				.txt {
					font-weight: bold;
					margin-left: 10rpx;
					
				}
				
				.blue-txt {
					color: #297EFF;
				}
			}
			
			.desc {
				margin-top: 20rpx;
				color: #999999;
				font-size: 24rpx;
			}
		}
		
		.money {
			color: #FF1F2E;
			font-size: 28rpx;
			
			.num {
				font-size: 32rpx;
				font-weight: bold;
			}
		}
	}
	
	.accessory-wrapper {
		width: 710rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		background-color: #fff;
		padding: 20rpx;
		border-radius: 16rpx;
		
		.title {
			display: flex;
			flex-direction: row;
			font-weight: bold;
			color: #1F1F1F;
			height: 48rpx;
			
			.sub-title {
				font-weight: 400;
				font-size: 24prx;
				color: #999999;
			}
		}
	}
	
	.accessory-item {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		background: #F5F7FA;
		border-radius: 8rpx;
		padding: 20rpx;
		margin-top: 20rpx;
	}
	
	.spu {
		width: 710rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		padding: 24rpx;
		box-sizing: border-box;
		background-color: #fff;
		border-radius: 16rpx;
		
		.sku-wrapper {
			width: 100%;
			height: 192rpx;
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			.image {
				height: 192rpx;
				width: 192rpx;
				
				image {
					width: 100%;
					height: 100%;
				}
			}
			
			.content {
				width: 440rpx;
				.title {
					font-size: 32rpx;
					line-height: 48rpx;
					color: #1F1F1F;
					font-weight: bold;
				}
				
				.sku-info {
					margin-top: 16rpx;
					font-size: 24rpx;
					color: #999;
				}
				
			}
		}
		
		.order-tip {
			margin-top: 20rpx;
			padding: 8rpx;
			color: #FF7029;
			background: rgba(255,112,41,0.08);
			border-radius: 8rpx;
		}
		
	}
	
	.date-wrapper {
		background: rgba(0,209,224,0.08);
		border-radius: 8rpx;
		display: flex;
		flex-direction: row;
		padding: 10rpx 0;
		margin-top: 20rpx;
		.item {
			flex: 1;
			display: flex;
			align-items: center;
			justify-content: center;
			
			.date-img {
				width: 58rpx;
				height: 58rpx;
				
				image {
					width: 100%;
					height: 100%;
				}
			}
			
			.content {
				margin-left: 10rpx;
				
				.title {
					font-size: 24rpx;
					color: #1F1F1F;
				}
				
				.date {
					font-size: 24rpx;
					margin-top: 8rpx;
					color: #999;
				}
			}
		}
	}
	
	.suipingxian-wrapper {
		width: 710rpx;
		height: 240rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		border-radius: 16rpx;
		overflow: hidden;
		background-color: #fff;
		position: relative;
		
		.img {
			width: 100%;
			height: 144rpx;
		}
		
		.content {
			position: absolute;
			height: 144rpx;
			width: 100%;
			left: 0;
			bottom: 0;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-radius: 16rpx;
			overflow: hidden;
			padding: 0 20rpx;
			background-color: #fff;
			
			.left {
				.title {
					font-size: 32rpx;
					font-weight: bold;
				}
				.desc {
					margin-top: 24rpx;
					color: #999;
					font-size: 24rpx;
				}
			}
			.right {
				color: #FF1F2E;
				font-weight: bold;
				font-size: 24rpx;
				.num {
					font-size: 32rpx;
				}
			}
		}
	}
	
	.footer-item {
		display: flex;
		flex-direction: row;
		padding: 24rpx 0;
		
		.check-img {
			width: 32rpx;
			height: 32rpx;
		}
	}
	
	.footer-text {
		font-size: 24rpx;
		color: #1F1F1F;
		margin-left: 8rpx;
		line-height: 32rpx;
	}
	
	.agreement-color {
		color: #71EBDA;
	}
</style>